home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 0195.ZIP / CIRCLE.LIB < prev    next >
Text File  |  1984-12-04  |  1KB  |  33 lines

  1. {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
  2. The purchaser of these procedures and functions may include them in COMPILED
  3. programs freely, but may not sell or give away the source text.
  4.  
  5.      Of course, CIRCLE works only in a graphics mode!
  6.  
  7.      The procedure CIRCLE has six parameters:
  8.          H and K:  the XY coordinates of the circle's center
  9.          R      :  itsRadius
  10.          Res    :  the Resolution.  This is proportional to
  11.                    the actual number of pixels used to draw the
  12.                    circle
  13.          Aspect :  Adjust this value until the circles are ROUND on
  14.                    your particular screen and for the particular
  15.                    graphics mode you are using.
  16.          Color  :  set to 0, 1, 2, or 3
  17.  
  18.  
  19. }
  20. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  21. procedure circle(H,K,R,Res : integer; Aspect : real; Color : byte);
  22. var
  23.   X, Y, Theta : integer;
  24. begin
  25.   for Theta := 1 to trunc(pi*2*Res) do
  26.     begin
  27.       X := H + trunc( R * sin(Theta/Res));
  28.       Y := K + trunc(Aspect * ( R * cos(Theta/Res)));
  29.       plot(X,Y,Color);
  30.     end;
  31. end;
  32. {@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
  33.